package com.shuaiche.yeguan.ui.select;

import android.content.Context;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shuaiche.yeguan.R;
import com.shuaiche.yeguan.model.SCCarBrandResponse;
import com.shuaiche.yeguan.util.GlideUtil;

import java.util.List;

/**
 * 类描述：推荐品牌列表适配器
 *
 * @auther: baoyinbo
 * @date: 2018/12/12 下午1:38
 */

public class SCCarBrandRecommendAdapter extends BaseQuickAdapter<SCCarBrandResponse> {
    private Context context;
    public SCCarBrandRecommendAdapter(Context context, List<SCCarBrandResponse> data) {
        super(R.layout.sc_item_car_brand_recommend_grid, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, SCCarBrandResponse model) {
        baseViewHolder.setText(R.id.tvBrand, model.getName());

        ImageView img = baseViewHolder.getView(R.id.ivBrand);
        GlideUtil.loadRoundImg(context, model.getLogo(), img, R.mipmap.default_error);
    }
}
